<template>
    <div class="arrow" :class="curDir == 'left' ? 'left' : 'right'" @click="arrowClick">
        <img :src="leftArrow1" />
    </div>
</template>

<script>
import leftArrow from '@/assets/images/controlCenter/leftArrow.png'
export default {
    props: {},
    name: 'loadingMask',
    data() {
        return {
            // 箭头方向，默认靠左，展开的
            curDir: 'left',
            leftArrow1: leftArrow
        }
    },
    mounted() {},
    methods: {
        arrowClick() {
            if (this.curDir == 'left') {
                this.curDir = 'right'
            } else {
                this.curDir = 'left'
            }
            this.$emit('arrowChange', this.curDir)
        }
    }
}
</script>

<style scoped lang="scss">
.left {
    left: 307px !important;
    img {
        transform: rotate(180deg) !important;
    }
}
.right {
    left: 0 !important;
    img {
        transform: rotate(0deg) !important;
    }
}
.arrow {
    background-color: #fff;
    z-index: 999;
    left: 307px;
    top: 49%;
    width: 35px;
    height: 35px;
    text-align: center;
    box-shadow: rgba(0, 0, 0, 0.35) 0px 2px 7px;
    border-radius: 45px;
    cursor: pointer;
    position: absolute;
    line-height: 35px;
    img {
        transform: rotate(180deg);
        width: 26px;
        height: 26px;
        margin-top: 5px;
        transition: transform 0.3s;
    }
}
</style>
